<template>
	<view class="pagesContent">
		<view class="list">
			<view class="item" @click="goPage('/pages/user/about')" style="border-bottom: 1.92rpx solid #E9E9E9;">
				<view class="left"> 关于我们 </view>
				<view class="right">
					<image class="icon" src="../../static/images/right.png" mode=""></image>
				</view>
			</view>
			<view class="item" @click="goPage('/pages/user/syslimits')">
				<view class="left"> 权限设置 </view>
				<view class="right">
					<image class="icon" src="../../static/images/right.png" mode=""></image>
				</view>
			</view>
			<view class="item" @click="goPage('/pages/user/bindMobile')" v-if="userInfo.need_bind_username">
				<view class="left">绑定手机号</view>
				<view class="right">
					<image class="icon" src="../../static/images/right.png" mode=""></image>
				</view>
			</view>
		</view>
		<view class="" style="clear: both;height:38.46upx;"> </view>
		<view class="list">
			<view class="item" @click="logOut">
				<view class="left">退出登录</view>
				<view class="right">
					<image class="icon" src="../../static/images/logOut.png" mode=""></image>
				</view>
			</view>
		</view>
		<view class="" style="height: 20rpx;"> </view>
		<adView></adView>
	</view>
</template>
<script>
	import {
		mapGetters,
		mapMutations,
		mapActions
	} from 'vuex';
	export default {
		data() {
			return {
				all: "0B",
				setList: [{
						href: "/pages/user/idea",
						icon: "../../static/images/set_0.png",
						name: "意见反馈"
					},
					{
						href: "/pages/user/server",
						icon: "../../static/images/set_1.png",
						name: "联系客服"
					},
					{
						href: "/pages/user/syslimits",
						icon: "../../static/images/set_2.png",
						name: "权限设置"
					},

					{
						href: "/pages/user/about",
						icon: "../../static/images/set_3.png",
						name: "关于我们",
					},








				]
			}
		},
		onShow() {
			this.$nextTick(() => {
				// #ifdef APP-PLUS
				this.getAppStorage()
				// #endif
			})
		},
		computed: {
			...mapGetters(["adpid", "userInfo"])
		},
		methods: {
			...mapMutations(['logout', 'updatelogin', "updateUserInfo", "updateToken", "updataAdSwitch", "updataDeviceId",
				"updataOaid"
			]),
			goPage(url) {
				uni.navigateTo({
					url: url
				})
			},
			clearStorage() {
				let this_ = this
				// #ifdef APP-PLUS
				uni.showLoading({
					title: "清理中"
				})
				//使用plus.cache.clear 清除应用中的缓存数据 这里清除后还要二十几KB没有清除，达不到全部清除
				plus.cache.clear(function() {
					this_.text("清理成功")
					this_.getAppStorage()
				});
				uni.hideLoading()
				// #endif
			},
			getAppStorage() {
				// 使用plus.cache.calculate 获取应用的缓存大小，
				// #ifdef APP
				plus.cache.calculate((size) => {
					//size是多少个字节单位是b
					//你可以做下面相应的处理
					if (size < 1024) {
						this.all = size + 'B';
					} else if (size / 1024 >= 1 && size / 1024 / 1024 < 1) {
						this.all = Math.floor(size / 1024 * 100) / 100 + 'KB';
					} else if (size / 1024 / 1024 >= 1) {
						this.all = Math.floor(size / 1024 / 1024 * 100) / 100 + 'M';
					}
					console.log(this.all)
				});
				// #endif
			},

			logOut() {

				this.logout()
				uni.removeStorageSync("token")
				uni.removeStorageSync("userSetAdSwitch")
				this.updataAdSwitch(true)
				this.goReLaunch("/pages/user/login")
			}


		}
	}
</script>
<style>
	page {}
</style>
<style lang="scss" scoped>
	.pagesContent {
		padding-top: 61.54rpx;
		height: 100vh;
		background: linear-gradient(180deg, #E1EBFF 0%, #FAFCFF 100%);

		.list {
			width: 673.08rpx;
			margin: 0 auto;
			background: #FFFFFF;
			border-radius: 23.08rpx;

			.item {
				padding: 0 0 0 30.77rpx;
				min-height: 115.38rpx;

				.left {
					float: left;
					height: 115.38rpx;
					line-height: 115.38rpx;
					color: #333333;
					font-size: 30.77rpx;
					font-weight: 600;
				}

				.right {
					float: right;
					width: 115.38rpx;
					height: 115.38rpx;
					display: flex;
					justify-content: center;
					align-items: center;

					.icon {
						width: 32rpx;
						height: 32rpx;
						display: block;

					}
				}
			}

		}

	}
</style>